1. Field of the Invention
The invention relates to an execution apparatus for executing a computer program.
2. Description of the Related Art
With regard to an apparatus that executes a computer program, an apparatus exists that loads a program from an external source that is equipped with a function that the apparatus is attempting to execute, in a case where the program is not loaded, and executes the program.
An example of the present apparatus is an apparatus that is outfitted with Java Virtual Machine, or JavaVM (Java is a trademark or registered trademark of Sun Microsystems Inc. in the U.S. and other countries). When the apparatus that is outfitted with JavaVM executes a Java application, it is able to load a required Java class from a class library that exists either within or without the apparatus (class loading). The component of JavaVM that is concerned with class loading is called the ClassLoader. Where the ClassLoader loads a class from is determined by a classpath configuration, as well as by the action of the ClassLoader itself.
In a case that the ClassLoader to be used is not specified, the SystemClassLoader that is built into JavaVM is used. The SystemClassLoader loads a class according to the classpath configuration. The classpath enumerates one or more paths, or locations where a class is loaded. The SystemClassLoader executes a class search through the path enumeration sequence, in descending order of priority. It is also possible to specify the ClassLoader to be used, in which case class are searched for and loaded according to the definition of the specified ClassLoader.
When the ClassLoader loads a class, a check is initially performed to ascertain whether or not the class to be loaded is present within JavaVM or within a library that is being provided in conjunction with JavaVM (Java System). If the class is present within the Java System, it is loaded therefrom. In other words, priority is given to loading from within the Java System, even if the required class is known to be located externally, together with the application. The first reason for doing so is that a class within the Java System ensures that Java functionality will be provided, thus maintaining interoperability of Java functionality. The second reason is that a class within the Java System is a solid class, with consideration for class security within the Java System.
Related art pertaining to class loading is cited in U.S. Pat. No. 6,260,078 and U.S. Pat. No. 6,701,335.
After the class library provided together with the application is stored within the Java System, the application loads classes from the class library within the Java System. Hence, the necessity for bundling the class library with the application is eliminated. The following sort of problem arises, however, if the version of the class library that is bundled with the application differs from the version of the class library that is located within the Java System.
The class library that is bundled with the application is guaranteed to work with the application. Attempting, instead, to use the class library that is located within the Java System, with a different version from the class library that is bundled with the application, however, may cause a fault to occur, owing to the fact that the class library that is located within the Java System is not guaranteed to work with the application. Such a condition may arise, for example, when installing a legacy application with which an old class library is bundled into a new Java System comprising a new class library. It is a nuisance to alter the legacy application in such a circumstance in a manner that would avoid the fault. The method of always using the class that is bundled with the application is also undesirable from a security standpoint.
Japanese Patent Laid Open No. 2002-014817 discloses a file distribution system that uses a computer network to distribute a program file. The file distribution system compares the version of a program module that is loaded into a file system of server with the version of a program module that is installed on a file system of client. The program module that is loaded into the file system of server is downloaded only in case that its version is newer than the version of the program module that is installed on the file system of client.